<template>
  <div>
    <el-form v-model="form">
      <el-select v-model="form.value" filterable placeholder="请选择" @change="sel">
        <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id">

        </el-option>
      </el-select>
      {{ form.value }}
    </el-form>
  </div>
</template>
<script>
import { listPartner ,getPartner} from '@/api/system/partner.js'
import { getOrder } from '@/api/system/order.js'
export default {
  data() {
    return {
      form: { value: null, },
      options: [
        // {
        //   id: 129,
        //   partnerName: '常州宏乐机械有限公司',
        //   name: '宏乐机械有限公司111'

        // },
        // {
        //   id: 128,
        //   partnerName: '常ces限公司',
        //   name: '宏有限ces 公司111'

        // }
      ],


    };
  },
  mounted() {
    this.getkehu()
    this.getdingdan()
  },
  methods: {
    sel(e) {
      console.log(typeof (e));
      console.log(typeof (this.form.value));

      console.log(typeof (e) === typeof (this.form.value));
      console.log(this.form);
    },
    getkehu() {
      const que = {
        pageNum: 1,
        pageSize: 10,
        customer: 't',
      }

      listPartner(que).then(res => {
        console.log(res);
        this.options = res.rows
        // console.log(this.options);
        // const op = res.rows
        // console.log(op);
        // this.options = op.map(item => ({ id: item.id, name: item.name }))
        // console.log(this.options);

      })
    },
    getdingdan() {


      getOrder(6248).then(res => {
        console.log(res);
        // this.getkehu()
        // this.form.value = String(res.data.partnerId)
        this.form.value = 127
        getPartner(this.form.value).then(resp => {
          console.log(resp);
        
          this.options.push(resp.data)
          // console.log(this.options);
})
        // console.log(typeof (this.value));
       

      })
    }
  },
  components: {},
  props: {},
  watch: {},
  computed: {},
  created() { },
};
</script>
<style lang="scss" scoped></style>